package leetcode.n2021;

/**
 * https://leetcode-cn.com/problems/jewels-and-stones/description/
 * https://leetcode.com/problems/jewels-and-stones/description/
 * @program: brushing
 * @description:
 * @author: LiuQiang
 * @create: 2018-07-26 09:32
 **/
public class JewelsAndStones {

    public int numJewelsInStones(String J, String S) {
        String js[] = J.split("");
        String ss[] = S.split("");
        int num = 0;
        for (String j: js) {
            for (String s: ss) {
                if(j.equals(s)){
                    num++;
                }
            }
        }
        return num;
    }


    public static void main(String[] args) {
        JewelsAndStones solution = new JewelsAndStones();
        System.out.println(solution.numJewelsInStones("z","aAAbbbb"));
    }
}
